<template>
    <el-table :data="tableData" style="width: 100%">
        <el-table-column type="index" label="序号" width="90" />
        <el-table-column prop="customerCode" label="客户编码" width="120" />
        <el-table-column prop="customerName" label="客户名称" width="150" />
        <el-table-column prop="cusAbbreviation" label="客户别名" width="120" />
        <el-table-column prop="customerPhone" label="客户手机号" width="120" />
        <el-table-column prop="customerAddress" label="客户地址" width="120" />
        <el-table-column prop="customerUnified" label="社会信用编码" width="120" />
        <el-table-column prop="customerMsg" label="客户备注" width="120" />
        <el-table-column prop="addProp" label="添加人" width="100" />
        <el-table-column prop="addTime" label="创建时间" width="120">
            <template #default="scope">
                {{ moment(scope.row.addTime).format("YYYY-MM-DD") }}
            </template>
        </el-table-column>
        <el-table-column prop="updProp" label="修改人" width="90" />
        <el-table-column prop="updTime" label="修改时间" width="120">
            <template #default="scope">
                {{ moment(scope.row.updTime).format("YYYY-MM-DD") }}
            </template>
        </el-table-column>
        <!-- <el-table-column fixed="right" label="操作" min-width="120">
            <template #default>
               <el-button link type="primary" size="small" @click="handleClick">
                    Detail
                </el-button>
                <el-button link type="primary" size="small">Edit</el-button>
            </template>
        </el-table-column> -->
    </el-table>
</template>

<script lang="ts" setup>
import Maxios from '@/Http/MesHelp';
import axios from 'axios';
import moment from 'moment';
import { onMounted, ref } from 'vue';

const handleClick = () => {
    console.log('click')
}

const tableData = ref([])

const page = ref({
    Pageindex: 1,
    Pagesize: 10,
    count: 0,
    page: 0
})

const list = () => {
    Maxios.get("/api/Supplier/ListCustomer").then(res => {
        tableData.value = res.data.data.list

        page.value.count = res.data.data.count
        page.value.page = res.data.data.page
    })
}

onMounted(() => {
    list()
})
</script>
